<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript"
			src="${path}/script/lhgdialog/lhgdialog.min.js">
</script>
		<script type="text/javascript">
		 
		
 $(function(){
 	$("#loginName").blur(function(){
 	
 		if($("#loginName").val())
 		{
 		
 		var url="${path}/manage/agenter/index/validate?loginName="+$("#loginName").val();
 		$.post(url, null, function(result) {
				 
					if (result.result) {
						$("#submit").removeAttr("disabled");
						 $("#nameKey").css("display","");
						 $("#nameValue").css("display","");
						 $("#branchKey").css("display","");
						 $("#branchValue").css("display","");
						 
						 $("#nameValue").html(result.username);
						 $("#branchValue").html(result.branchname);
						 
					} else {
					
						 $("#nameKey").css("display","none");
						 $("#nameValue").css("display","none");
						 $("#branchKey").css("display","none");
						 $("#branchValue").css("display","none");
						 
							 alert(result.msg);
						 
					}
					

				});
				}
 	});
 	
 	
 	$("#submit").click(function(){
 		var data = $("#form1").serialize();
 		var url="${path}/manage/agenter/index/updatePwd";
 		
 		art.dialog( {
		lock : true,
		content : '确定要修改吗？',
		ok : function() {
			 
			$.post(url, data, function(result) {
					if (result.result) {
						
						 $("#nameKey").css("display","");
						 $("#nameValue").css("display","");
						 $("#branchKey").css("display","");
						 $("#branchValue").css("display","");
						 
						 $("#nameValue").html(result.username);
						 $("#branchValue").html(result.branchname);
						 alert(result.msg);
						 location.reload();
					} else {
							 alert(result.msg);
					}
					

				});
		},
		cancelVal : '取消',
		cancel : true
	});
 		
 		
 	});
 	
 })
 
</script>

	</head>

	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
		<!--右边-->
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					重置密码
					<div class="tools-btn">
						 
					</div>
				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding-top: 12px;">
					<div class="search">
						<!----------- 查询信息 ------------------>
						<form method="post" name="form1" id="form1">
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td width="">
										用户名：
									</td>
									<td>
										<input type="text" name="loginName" id="loginName"
											class="input-txt" value="${loginName}"  ><font color="red">*</font>不能为空
									</td>
							  
								</tr>
								<tr>
										<td id="nameKey" style="display: none;">
											姓名：
										</td>
										<td id="nameValue" style="display: none;">
											 
										</td>
								</tr>
								
								<tr>
									<td width="" id="branchKey" style="display: none;">
										机构：
									</td>
									<td id="branchValue" style="display: none;">
										 &nbsp;
									</td>
								</tr>
								
								<tr>
									<td >
										
										新密码：
									</td>
									<td>
										 <input type="password" class="input-txt" id="pwd" name="pwd"/>
										 <font color="red">*</font>长度为7到14位，必须含有字母，数字，特殊字符
									</td>
								</tr>
								
								<tr>
									 <td >
										
										重复新密码：
									</td>
									<td>
										 <input type="password" class="input-txt" id="pwd2" name="pwd2"/>
										 <font color="red">*</font>与新密码的值相同<font color="red">
									</td>
								</tr>
								
								<tr>
									 <td >
										<input type="button" class="linkbtn2" value="修改" id="submit" disabled="disabled"/>
										
									</td>
									<td></td>
								</tr>

							</table>
						</form>
					</div>
					 

				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>

		<sfa:mainFooter></sfa:mainFooter>

	</body>
</html>


